package org.thanos.iot.service.graphic.impl;

import com.honeywell.tj.iot.entity.graphic.GraphicComponentFile;
import com.honeywell.tj.iot.mapper.graphic.GraphicComponentFileMapper;
import com.honeywell.tj.iot.service.graphic.GraphicComponentFileService;
import com.honeywell.tj.iot.vo.graphic.GraphicComponentFileWithPathVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("graphicComponentFileService")
public class GraphicComponentFileServiceImpl implements GraphicComponentFileService {

    @Resource
    private GraphicComponentFileMapper graphicComponentFileMapper;

    @Override
    public List<GraphicComponentFileWithPathVo> getComponentFiles(Integer componentId) {
        return graphicComponentFileMapper.selectComponentFilesByComponentId(componentId);
    }

    @Override
    public List<Integer> getComponentFileIds() {
        return graphicComponentFileMapper.selectComponentFileIds();
    }

    @Override
    public int createComponentFiles(List<GraphicComponentFile> graphicComponentFiles) {
        return graphicComponentFileMapper.insertComponentFiles(graphicComponentFiles);
    }

    @Override
    public int deleteComponentFile(Integer graphicComponentId) {
        return graphicComponentFileMapper.deleteComponentFilesByComponentId(graphicComponentId);
    }

    @Override
    public int deleteComponentFiles(List<Integer> componentIds) {
        return graphicComponentFileMapper.deleteComponentFilesByComponentIds(componentIds);
    }
}


